package com.ruoyi.web.controller.eduManage;

import com.ruoyi.eduManage.domain.EduStudentPointsLog;
import com.ruoyi.eduManage.service.IEduStudentPointsLogService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/manage/student/pointsLog")
public class EduStudentPointsLogController extends BaseController {
    @Autowired
    private IEduStudentPointsLogService pointsLogService;

    /**
     * 按学生ID查询积分变更记录
     */
    @PreAuthorize("@ss.hasPermi('manage:student:query')")
    @GetMapping("/list")
    public TableDataInfo list(Long studentId) {
        startPage();
        List<EduStudentPointsLog> list = pointsLogService.selectEduStudentPointsLogListByStudentId(studentId);
        return getDataTable(list);
    }
}